﻿namespace LeetCodeProject._0001_1000._001_100._91_100._100;

public class Solution
{
    public bool IsSameTree(TreeNode p, TreeNode q)
    {
        if (p == null)
            return q == null;
        if (q == null)
            return p == null;
        return p.val == q.val && IsSameTree(p.left, q.left) && IsSameTree(p.right, q.right);
    }
}